﻿using Sidvall.Collections;
using System.Collections.Generic;

namespace Sidvall.Logging
{
    public class LogCategory
    {
        #region Public Members

        public string Name { get; set; }
        #region EnabledEventTypes

        private HashSet<EventType> _EnabledEventTypes;
        public HashSet<EventType> EnabledEventTypes
        {
            get
            {
                return _EnabledEventTypes;
            }
            private set
            {
                _EnabledEventTypes = value;
            }
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            if ((this.EnabledEventTypes != null) && (this.EnabledEventTypes.Count > 0))
            {
                return this.Name + " (" + this.EnabledEventTypes.JoinToString(", ") + ")";
            }
            return this.Name;
        }

        #endregion

        #endregion
        #region Constructors

        public LogCategory()
        {
            this.EnabledEventTypes = new HashSet<EventType>();
        }

        #endregion
    }
}
